package com.example.zhinongbao.Model;

import android.content.Context;

import com.example.zhinongbao.database.UserInfoDao;
import com.example.zhinongbao.entity.UserInfo;


public class UpdatePasswordImpl implements IUpdatePassword {
    private UserInfoDao userInfoDao ;
    public UpdatePasswordImpl(Context context){userInfoDao = new UserInfoDao(context);}


    @Override
    public void updateLoginPassword(String username, String newPassword) {
        userInfoDao.updatePasswordByUserName(username, newPassword);
    }

    @Override
    public void updatePayPassword(String username,  String newPayPassword) {
        userInfoDao.updatePayPasswordByName(username,  newPayPassword);
    }


    @Override
    public UserInfo getUserByName(String username) {
        return userInfoDao.getUserByName(username);
    }
}
